import com.xxh.kfc.dao.TypeDao;
import com.xxh.kfc.dao.UserDao;
import com.xxh.kfc.entity.Type;
import com.xxh.kfc.entity.User;
import com.xxh.kfc.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.HashMap;
import java.util.List;

public class test {

    @Test
    public  void testMybatis(){
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
//        BookDao mapper = sqlSession.getMapper(BookDao.class);
//        Book book = mapper.selectByPrimaryKey(1);

//        TypeDao mapper = sqlSession.getMapper(TypeDao.class);
//        List<Type> foods = mapper.getTypeByMeal(1);
//        System.out.println(foods.toString());

//        UserDao mapper = sqlSession.getMapper(UserDao.class);
//        User xiong = mapper.login("xiong", "123");
//        System.out.println(xiong.toString());

        HashMap map = new HashMap<Integer,Integer>();
        String[] values={"1:2","2:5","3:6"};
        for(String str:values){
            String[] split = str.split(":");
            String fid = split[0];
            String fnum = split[1];
            map.put(fid,fnum);
        }
        System.out.println(map.toString());
    }
}
